<template>
    <div class="child1">
        这是child1组件内容

        <h1>这是child1---  {{$store.state.count}}</h1>

        <el-button @click="child1Add">自增</el-button>       
    </div>
</template>
<script>
export default {
    data() {
        return{}
    },
    methods:{
        child1Add(){
           this.$store.commit('addCount')
        }
    }
}
</script>

<style lang="scss" scoped>
.child1{
    width: 400px;
    height: 200px;
    border: 2px solid blue;
}
</style>

